<template>
  <div>
    <ul class="parent list-group">
      <li
        class="list-group-item"
        v-for="item in childRefs?.list"
        :key="item"
      >
        {{ item }}
      </li>
    </ul>
    <!-- 子组件 ref的值与<script>中的保持一致 -->
    <Child ref="childRefs"></Child>
    <!-- 父组件 -->
  </div>
</template>
<script setup>
import { ref } from 'vue';
import Child from './Child.vue';
const childRefs = ref(null);
console.log(childRefs);
</script>
